题目地址 (opens new window)
解题代码
public ListNode removeElements(ListNode head, int val) { if (head == null) { return null; } ListNode res = removeElements(head.next, val); if (head.val == val) { return res; } else { head.next = res; return head; } }
← LeetCode 相交链表 LeetCode 统计优美子数组 →